﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using Modules.Core;

namespace ComputerStoreManager.ViewModel {
    public delegate void OnAddInvoiceSellHandler();
    //public delegate void OnAddInvoiceBuyHandler();
    public delegate void OnViewInvoiceSellHandler();
    //public delegate void OnViewInvoiceBuyHandler();
    class InvoiceControlViewModel {
        #region ICommand
        public ICommand AddInvoiceSellCommand {
            get;
            private set;
        }
        public ICommand AddInvoiceBuyCommand {
            get;
            private set;
        }
        public ICommand ViewInvoiceSellCommand {
            get;
            private set;
        }
        public ICommand ViewInvoiceBuyCommand {
            get;
            private set;
        }
        #endregion

        #region Events
        public event OnAddInvoiceSellHandler OnAddInvoiceSellClicked;
        //public OnAddInvoiceBuyHandler OnAddInvoiceBuyClicked;
        public event OnViewInvoiceSellHandler OnViewInvoiceSellClicked;
        //public OnViewInvoiceBuyHandler OnViewInvoiceBuyClicked;
        #endregion

        public void InitCmd() {
            AddInvoiceSellCommand = new ExecutableCommand(DoAddInvoiceSell);
            //AddInvoiceBuyCommand = new ExecutableCommand(DoAddInvoiceBuy);
            ViewInvoiceSellCommand = new ExecutableCommand(DoViewInvoiceSell);
            //ViewInvoiceBuyCommand = new ExecutableCommand(DoViewInvoiceBuy);
        }

        public void DoAddInvoiceSell() {
            if (OnAddInvoiceSellClicked != null) {
                OnAddInvoiceSellClicked();
            }
        }
        //public void DoAddInvoiceBuy() {
        //    if (OnAddInvoiceBuyClicked != null) {
        //        OnAddInvoiceBuyClicked();
        //    }
        //}
        public void DoViewInvoiceSell() {
            if (OnViewInvoiceSellClicked != null) {
                OnViewInvoiceSellClicked();
            }
        }
        //public void DoViewInvoiceBuy() {
        //    if (OnViewInvoiceBuyClicked != null) {
        //        OnViewInvoiceBuyClicked();
        //    }
        //}
    }
}
